﻿using System;
using System.Data;
using System.Linq;
using ReflectionStudio.Core.Events;
namespace WPFExcelReport
{
    public partial class ITXEXRPT
    {
        public void JLTAB55B()
        {
            try
            {
                DataTable dtrSoruce = dsSource.Tables["WB"];
                string WBBSTKNR = "", ORDERNO = "", ART = "", BARCODE = "";
                int x = dsSource.Tables["WB"].Rows.Count;
                int i = 0;
                int rows = 12;
                foreach (DataRow dw in dtrSoruce.Rows)
                {
                    ART = dw["ART"].ToString().Trim();
                    ORDERNO = dw["ORDERNO"].ToString().Trim();
                    BARCODE = "*" + dw["WBBSTKNR"].ToString().Trim() + "*";
                    WBBSTKNR = dw["WBBSTKNR"].ToString().Trim();
                    exAgent.SetCellValue(i * rows + 1, 1, "花型号：");
                    exAgent.SetCellValue(i * rows + 1, 4, ART);
                    exAgent.SetCellValue(i * rows + 2, 1, "上机单：");
                    exAgent.SetCellValue(i * rows + 2, 4, ORDERNO);
                    exAgent.SetCellValue(i * rows + 3, 1, BARCODE);
                    exAgent.SetCellValue(i * rows + 5, 1, WBBSTKNR);
                    exAgent.SetCellValue(i * rows + 1+6, 1, "花型号：");
                    exAgent.SetCellValue(i * rows + 1+6, 4, ART);
                    exAgent.SetCellValue(i * rows + 2+6, 1, "上机单：");
                    exAgent.SetCellValue(i * rows + 2+6, 4, ORDERNO);
                    exAgent.SetCellValue(i * rows + 3+6, 1, BARCODE);
                    exAgent.SetCellValue(i * rows + 5 + 6, 1, WBBSTKNR);
                    i = i + 1;
                    if (i < x)
                    {
                        exAgent.RangeCopy(1, 12, i * 12 + 1, i * 12 + 12);
                    }
                }
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
        } 
    }
}